#ifndef _SIMPLE_LOGGER_H
#define _SIMPLE_LOGGER_H
#include "ILogger.h"

class SimpleLoggerAppendData : public ILoggerAppendData{
public:
     std::string toString(const LoggerAppendData &data);
};

class LoggerConsoleSink : public ILoggerSink {
public:
    void printLine(int level, const char *buf) override;
};
/**
 * @brief 
 * <bean name="log" interface="ILogger" implemation="SimpleLogger">
 *  <log level="6"/>
 *  <sink implemation="LoggerConsoleSink"/>
 *  <append implemation="SimpleLoggerAppendData" filter="all"/>
 * </bean>
 */
class SimpleLogger : public ILogger {
public:
    void log(LoggerAppendData *data,LogLevelType nLogLevel, const std::string &content);
    void onLoad(INode *node);
private:
    int logLevel;
    std::string appendName;
    std::vector<ILoggerSink*>  sinks;
    ILoggerAppendData* append;
};

#endif //_SIMPLE_LOGGER_H
